home *** CD-ROM | disk | FTP | other *** search
- *** c-typeck.c 1993/10/26 17:00:09 1.152
- --- c-typeck.c 1993/10/27 19:51:28
- ***************
- *** 3469,3475 ****
- if (field)
- {
- char *name;
- ! tree nvalue;
-
- if (pedantic)
- pedwarn ("ANSI C forbids casts to union type");
- --- 3469,3475 ----
- if (field)
- {
- char *name;
- ! tree t;
-
- if (pedantic)
- pedwarn ("ANSI C forbids casts to union type");
- ***************
- *** 3482,3490 ****
- }
- else
- name = "";
- ! return digest_init (type, build (CONSTRUCTOR, type, NULL_TREE,
- ! build_tree_list (field, value)),
- ! 0, 0);
- }
- error ("cast to union type from type not present in union");
- return error_mark_node;
- --- 3482,3492 ----
- }
- else
- name = "";
- ! t = digest_init (type, build (CONSTRUCTOR, type, NULL_TREE,
- ! build_tree_list (field, value)),
- ! 0, 0);
- ! TREE_CONSTANT (t) = TREE_CONSTANT (value);
- ! return t;
- }
- error ("cast to union type from type not present in union");
- return error_mark_node;
- ***************
- *** 4033,4038 ****
- --- 4035,4044 ----
- switch (TREE_CODE (value))
- {
- case CONSTRUCTOR:
- + if (TREE_CODE (TREE_TYPE (value)) == UNION_TYPE
- + && TREE_CONSTANT (value))
- + return initializer_constant_valid_p (TREE_VALUE (CONSTRUCTOR_ELTS (value)));
- +
- return TREE_STATIC (value) ? null_pointer_node : 0;
-
- case INTEGER_CST:
- ***************
- *** 5688,5695 ****
- 0);
- goto retry;
- }
- ! else if (tree_int_cst_lt (DECL_FIELD_BITPOS (TREE_PURPOSE (tail)),
- ! DECL_FIELD_BITPOS (constructor_unfilled_fields)))
- ;
- else if (next == 0
- || tree_int_cst_lt (DECL_FIELD_BITPOS (TREE_PURPOSE (tail)),
- --- 5694,5702 ----
- 0);
- goto retry;
- }
- ! else if (constructor_unfilled_fields == 0
- ! || tree_int_cst_lt (DECL_FIELD_BITPOS (TREE_PURPOSE (tail)),
- ! DECL_FIELD_BITPOS (constructor_unfilled_fields)))
- ;
- else if (next == 0
- || tree_int_cst_lt (DECL_FIELD_BITPOS (TREE_PURPOSE (tail)),
-
-